package com.yedean.factory.support;

import com.yedean.factory.config.BeanDefinition;

import java.util.HashMap;
import java.util.Map;

/**
 * DafaultListableBeanFactory 默认可列出beanDefiniton的bean工厂
 * 1.提供bean定义的集合
 *
 * @author yedean
 * @date 2022/6/28
 */
public class DafaultListableBeanFactory extends AbstractAutowireCapableBeanFactory implements BeanDefinitionRegistry{
    
    private final Map<String, BeanDefinition> beanDefinitionMap =new HashMap<>();


    @Override
    protected BeanDefinition getBeanDefinition(String name) {
        return beanDefinitionMap.get(name);
    }

    @Override
    public void registerBeanDefinition(String name, BeanDefinition beanDefinition) {
        beanDefinitionMap.put(name,beanDefinition);
    }
}
